package cn.rayland.app.yandktest;

/**
 * Created by Lei on 2/4/2016.
 */
public class Machine {
    public Axis axis_x;
    public Axis axis_y;
    public Axis axis_z;
    public Extruder extruder_a;
    public Extruder extruder_b;
    public double filamentDiameter;
    public double packingDensity;
    public double nozzleDiameter;
    public int extruderCnt;
    public int timeout;
    public int type;

    public Machine() {
    }

    public Machine(Axis thisX, Axis thisY, Axis thisZ, Extruder thisA, Extruder thisB, double thisFilamentDiameter, double thisPackingDensity,
                   double thisNozzleDiameter, int thisExtruderCnt, int thisTimeout, int thisType)
    {
        axis_x = thisX;
        axis_y = thisY;
        axis_z = thisZ;
        extruder_a = thisA;
        extruder_b = thisB;
        filamentDiameter = thisFilamentDiameter;
        packingDensity = thisPackingDensity;
        nozzleDiameter = thisNozzleDiameter;
        extruderCnt = thisExtruderCnt;
        timeout = thisTimeout;
        type = thisType;
    }

    @Override
    public String toString() {
        return "Machine{" +
                "axis_x=" + axis_x.toString() +
                ", axis_y=" + axis_y.toString() +
                ", axis_z=" + axis_z.toString() +
                ", extruder_a=" + extruder_a.toString() +
                ", extruder_b=" + extruder_b.toString() +
                ", filamentDiameter=" + filamentDiameter +
                ", packingDensity=" + packingDensity +
                ", nozzleDiameter=" + nozzleDiameter +
                ", extruderCnt=" + extruderCnt +
                ", timeout=" + timeout +
                ", type=" + type +
                '}';
    }

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		Machine other = (Machine) obj;
		if (axis_x == null) {
			if (other.axis_x != null)
				return false;
		} else if (!axis_x.equals(other.axis_x))
			return false;
		if (axis_y == null) {
			if (other.axis_y != null)
				return false;
		} else if (!axis_y.equals(other.axis_y))
			return false;
		if (axis_z == null) {
			if (other.axis_z != null)
				return false;
		} else if (!axis_z.equals(other.axis_z))
			return false;
		if (extruderCnt != other.extruderCnt)
			return false;
		if (extruder_a == null) {
			if (other.extruder_a != null)
				return false;
		} else if (!extruder_a.equals(other.extruder_a))
			return false;
		if (extruder_b == null) {
			if (other.extruder_b != null)
				return false;
		} else if (!extruder_b.equals(other.extruder_b))
			return false;
		if (Double.doubleToLongBits(filamentDiameter) != Double
				.doubleToLongBits(other.filamentDiameter))
			return false;
		if (Double.doubleToLongBits(nozzleDiameter) != Double
				.doubleToLongBits(other.nozzleDiameter))
			return false;
		if (Double.doubleToLongBits(packingDensity) != Double
				.doubleToLongBits(other.packingDensity))
			return false;
		if (timeout != other.timeout)
			return false;
		if (type != other.type)
			return false;
		return true;
	}
    
    
}
